# coding: utf-8
from sqlalchemy import Column, DateTime, Integer, String
from sqlalchemy.schema import FetchedValue
from application import db


# db = SQLAlchemy()


class Article(db.Model):
    __tablename__ = 'article'

    article_id = db.Column(db.String(50), primary_key=True)
    blog_id = db.Column(db.String(50), nullable=False)
    article_name = db.Column(db.String(500))
    article_time = db.Column(db.DateTime)
    article_ip = db.Column(db.String(15))
    article_click = db.Column(db.Integer)
    user_id = db.Column(db.String(50))
    article_column_id = db.Column(db.String(50))
    article_model = db.Column(db.String(50))
    article_content = db.Column(db.String)
    article_up = db.Column(db.String(1))
    article_support = db.Column(db.String(1))
    title = db.Column(db.String(500))
    edit_mode = db.Column(db.String(50))
    summary = db.Column(db.String(500))
    link_to = db.Column(db.String(200))
    thumbnail = db.Column(db.String(100))
    style = db.Column(db.String(100))
    order_number = db.Column(db.Integer)
    status = db.Column(db.String(1))
    comment_status = db.Column(db.String(1))
    comment_count = db.Column(db.Integer)
    comment_time = db.Column(db.DateTime)
    view_count = db.Column(db.Integer, server_default=db.FetchedValue())
    create_time = db.Column(db.DateTime)
    update_time = db.Column(db.DateTime)
    meta_keywords = db.Column(db.String(500))
    meta_description = db.Column(db.String(500))
    remarks = db.Column(db.String(500))
    del_flag = db.Column(db.Integer)
    article_Type = db.Column(db.String(500))
    article_sub_category = db.Column(db.String(500))
    article_sub_categorys = db.Column(db.String(500))
    article_like_num = db.Column(db.Integer, server_default=db.FetchedValue())
